﻿using Microsoft.Data.Objects;
using Model;

namespace Configuration.ModelConfiguration
{
    public class tkntImageConfiguration : EntityConfiguration<tkntImage>
    {
        public tkntImageConfiguration()
        {
            Property(c => c.Id).IsIdentity();
            Property(c => c.Url).HasMaxLength(500).IsRequired();
            Property(c => c.IsAvatar);

            Relationship(c => c.Product).IsOptional();
            Relationship(c => c.Product).FromProperty(e => e.Images);
        }
    }
}